#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string.h>
#include<Windows.h>
#include<stdlib.h>
char* insert(char s[], char t[], int i)
{
	char string[100];
	if (i<0 || i>(int)strlen(s))
	{
		printf("error!\n");
		exit(1);
	}
	if (!strlen(s))
	{
		strcpy(s, t);
	}
	else if (strlen(t))
	{
		strncpy(string, s, i);
		string[i] = '\0';
		strcat(string, t);
		strcat(string, s + i);
		strcpy(s, string);
		return s;
	}
}

int main()
{
	char str1[100], str2[200];
	int position;
	printf("Input the first string:\n");
	gets_s(str1);
	printf("Input the second string:\n");
	gets_s(str2);
	printf("please input position:\n");
	scanf("%d", &position);
	insert(str1, str2, position);
	puts(str1);
}